package org.ncibi.cytoscape.metscape.action;

import java.awt.event.ActionEvent;

import org.ncibi.cytoscape.metscape.ui.LegendDialog;

import cytoscape.Cytoscape;
import cytoscape.util.CytoscapeAction;

@SuppressWarnings("serial")
public class ShowLegendAction extends CytoscapeAction {
	
	public static final String NAME = "Show Legend";
	LegendDialog dialog;
	
	/**
	 * The constructor sets the text that should appear on the menu item.
	 */
	public ShowLegendAction() {
		super(NAME);
	}

	/**
	 * This method is called when the user selects the menu item.
	 */
	public void actionPerformed(ActionEvent ae) {
		if(dialog == null) {
			dialog = new LegendDialog(Cytoscape.getDesktop());
		}
		dialog.setVisible(true);
	}		
}